import {HTTP} from "../../utils/http";

const BASE_URL = "HomePage/"
const GET_SCHOOL_PAGE = `${BASE_URL}get_school_list`
const GET_SCHOOL_DETAIL = `${BASE_URL}get_school_details`
const GET_SCHOOL_TEACHER = `${BASE_URL}get_teacher_list`
class SchoolModel extends HTTP{

    constructor(){
        super()
    }


    /**
     * 获取学校列表
     * @param type
     * @param current
     * @param pageSize
     * @returns {*|Promise|Promise<any>}
     */
    getSchoolPage(type,current,pageSize){

        return this.request({
            url: GET_SCHOOL_PAGE,
            data:{
                type: type,
                page: current,
                pagesize: pageSize
            }
        })

    }

    /**
     * 获取学校详情
     * @param sId
     * @returns {*|Promise|Promise<any>}
     */
    getSchoolDetail(sId){
        return this.request({
            url: GET_SCHOOL_DETAIL,
            data:{
                s_id: sId
            }
        })
    }

    /**
     * 获取学校教师
     * @param sId
     * @param current
     * @param pageSize
     * @returns {*|Promise|Promise<any>}
     */
    getSchoolTeacher(sId,current,pageSize){

        return this.request({
            url: GET_SCHOOL_TEACHER,
            data:{
                s_id: sId,
                page: current,
                pagesize: pageSize
            }
        })

    }


}
export {SchoolModel}